<template>
  <div class="app-container">

    <el-table :data="list" border fit highlight-current-row style="width: 100%">
      <el-table-column label="tuid" width="220" align="center">
        <template slot-scope="scope">{{ scope.row.tuid }}</template>
      </el-table-column>
      <el-table-column label="被攻击的名称" width="120" align="center">
        <template slot-scope="scope">{{ scope.row.tname }}</template>
      </el-table-column>
      <el-table-column label="tRobot" width="70" align="center">
        <template slot-scope="scope">{{ scope.row.tRobot }}</template>
      </el-table-column>
      <el-table-column label="res">
        <template slot-scope="scope">
          {{ jsonObjToStr(scope.row.res) }}
        </template>
      </el-table-column>
      <el-table-column label="属性变化">
        <template slot-scope="scope">
          {{ jsonObjToStr(scope.row.uProp) }}
        </template>
      </el-table-column>
      <el-table-column label="时间" width="160" align="center">
        <template slot-scope="scope">
          {{ scope.row.time | formatDate }}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { fireList } from '@/api/loglist'

export default {
  data() {
    return {
      list: null,
      total: 0,
      listQuery: {
        page: 1,
        pageNum: 20,
        name: ''
      }
    }
  },
  methods: {
    fetchData() {
      fireList(this.listQuery).then(response => {
        this.total = response.data.count
        this.list = response.data.logList
      })
    },
    handleFilter() {
      this.fetchData()
    }
  }
}
</script>
